//
//  QWHttpFactory.m
//  117goFramework
//
//  Created by Yunhai.Wu on 15/7/29.
//  Copyright (c) 2015年 117go. All rights reserved.
//

#import "QWHttpFactory.h"
#import "QWLoggingMacros.h"
#import "QWHttpEngineConfig.h"


@implementation QWHttpFactory

+(id<IQWHttpEngine>)buildHttpEngine {
    id<IQWHttpEngine> httpEngine = nil;
    Class engineClazz = [[QWHttpEngineConfig sharedInstance] defaultEngine];
    if (engineClazz) {
        httpEngine = [[engineClazz alloc] init];
        QWLogVerbose(@"构建 %@",NSStringFromClass(engineClazz));
    } else {
        @throw [NSException exceptionWithName:@"QWHttpFactoryException" reason:@"请在使用 QWHttpEngineConfig配置http组件默认引擎" userInfo:nil];
    }
    return httpEngine;
}

@end
